This invention relates to an image processing apparatus, an image processing method, and an image processing system for executing color conversion for input color image data so that the color image data falls within the color reproduction range of an output device.
Image processing includes color conversion processing of executing color conversion for color image data so that the color image data falls within the color reproduction range of the device for visualizing the color image data. For example, to output a color image to a CRT or a printer, not all colors can be represented and only colors within the color reproduction range of the device are output. When input color image data has a portion beyond the color reproduction range, color conversion processing is required for converting unreproduced colors beyond the color reproduction range into reproducible colors.
Hitherto, various methods have been designed for color conversion as to how colors not reproduced in an image output device are reproduced, and some software products that can execute color conversion have a function for such a purpose. Representative techniques of such color conversion processing include a conversion method for holding gradation, that for holding hue, and that for holding lightness.
The conversion method for holding gradation is a method of changing not only colors outside the color reproduction range, but also colors in the color range of color image data at one rate for compression so as to place all colors within the color reproduction range. This method holds color differences and therefore holds color change such as gradation. Thus, it is an optimum method as color conversion for an image such as a photo attaching importance to gradation. However, when colors within the color reproduction range in which an original image can be reproduced faithfully are changed largely, the method may be inferior in color reproducibility as a result.
In the conversion method for holding hue or lightness, only colors outside the color reproduction range are changed to boundary colors of the color reproduction range with hue or lightness held, whereby whole color change is eliminated and only unreproducible colors are converted. However, if colors resulting from changing the colors outside the color reproduction range or colors close to the resulting colors already exist in the original image, discrimination between the colors and the original colors is degraded. For example, if a part of a gradation portion is outside the color reproduction range, the colors in the part of gradation become the same color by the conversion and the gradation is lost. For another example, the original image portions different in color become the same color and the colors cannot be distinguished from each other.
Thus, the conversion methods have merits and demerits and a conversion method for producing good results for every image is not available. Therefore, in the current mainstream techniques, generally a method of adopting the conversion method considered to be the most favorable for the original type is often used. For example, if the original is an image such as a photo, importance is attached to gradation and the conversion method for holding gradation is adopted; if the original is a graph used in business, etc., importance is attached to lightness and the conversion method for holding lightness is used.
However, if the conversion method is thus selected according only to the original type, the demerits of the selected conversion method are reflected on the output image intact, thus the user may feel dissatisfaction. For example, if the original is determined to be an image attaching importance to gradation, such as a photo, and color conversion is executed by the conversion method for holding gradation, reproducible colors are also converted into different colors, thus a problem remains in color reproducibility. If the conversion method for holding hue or lightness is selected for executing conversion, different colors of the original image become the same, as a result of the conversion and cannot be distinguished from each other. For example, there is a possibility that a problem may occur such that although a map is colored, the colors cannot be distinguished from each other as a result of conversion or that although a gradation portion should exist in a part, flat color representation results. These problems are caused by the fact that the color conversion method is selected according only to the original type; there may be a problem in that the image contents are not considered.
For example, a system described in the Unexamined Japanese Patent Application Publication No. Hei 5-167839 counts the number of pixels outside the color reproduction range.
If the ratio of the number of pixels outside the color reproduction range is small, the conversion method for holding hue is adopted; if the ratio of the number of pixels within the color reproduction range is small, the conversion method for holding gradation is adopted. Further, a system described in the Unexamined Japanese Patent Application Publication No. Hei 6-162181 divides a color space into blocks for each hue and counts the number of pixels outside the color reproduction range for each block. If a block with a large ratio of the count exists, the conversion method for holding gradation is used; otherwise, the conversion method for holding hue is used. In the systems, the conversion method is selected for each block. Thus, even if the original is a photo, a part of the gradation portion becomes flat or even if the original is an image with large flat portions, the original colors are not reproduced if a large number of pixels are beyond the color reproduction range.
Described in the Unexamined Japanese Patent Application Publication No. Hei 5-227418 are a method of counting the number of pixels outside the color reproduction range, preparing a histogram, and using the conversion method for holding gradation so as to place 90% pixels of the count in the color reproduction range, a method of determining conversion scaling interactively, and the like. Problems similar to those described above also exist in the art described in the Unexamined Japanese Patent Application Publication No. Hei 5-227418.
For example, a color image converter described in the Unexamined Japanese Patent Application Publication No. Hei 7-203234 divides an equal color space into unit areas, finds the number of pixels contained in each unit area, maps unit areas outside the color reproduction range to other color unit areas constant in lightness in response to the number of pixels, and executes color conversion. According to the art, conversion of the colors outside the color reproduction range to the same colors as other used colors is lessened, thus gradation color change is represented in different colors and if the original image is represented in different colors, the image resulting from conversion are also represented in different colors; degradation of color discrimination can be reduced. Further, since the colors within the color reproduction range are represented in intact colors in most cases, unnecessary color change is prevented and color reproducibility is enhanced. However, since color mapping is executed only for the unit areas outside the color reproduction range, for example, for continuous gradation from the colors within the color reproduction range to the colors outside the range, color continuity is impaired due to color change in portions outside the color reproduction range and desired gradation cannot be represented.
Thus, in the prior arts, it may be impossible to represent gradation portions as gradation and represent flat portion colors in appropriate colors for the flat portions; it is difficult to provide an output image satisfactory to the user.
On the other hand, when the user criticizes the color difference between input and output images, for example, he or she often takes out a part of the image and comments on the color difference and discrimination degradation. The image portions whose color difference is discussed are often flat tone portions and comparison such that some colors in the gradation portions differ is not much made. In contrast, the difference between colors placed in the neighborhood becomes a comparison object in gradation portions in many cases. For example, if a gradation portion becomes almost flat tone as discrimination is degraded, it becomes a factor unsatisfactory to the user.
Thus, different criteria are applied to flat tone and gradation portions even in one image and if the same color conversion is executed, either must be sacrificed. Optimum color conversion may be executed in response to parts of an image in such a manner that different conversion methods are applied to the flat tone and gradation portions. However, prior art for such purpose does not exist as things stand now.